//
//  UIButton+Extension.swift
//  SinaMicroblog
//
//  Created by 唐绍禹 on 15/8/7.
//  Copyright © 2015年 唐绍禹. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(title: String,fontsize: CGFloat,color: UIColor) {
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontsize)
        backgroundColor = UIColor.grayColor()
    }
    
    convenience init(title: String,imageName: String, fontsize: CGFloat,color: UIColor) {
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontsize)
        setBackgroundImage(UIImage(named: "timeline_card_middle_background_highlighted"), forState: UIControlState.Highlighted)
        setBackgroundImage(UIImage(named: "timeline_card_middle_background"), forState: UIControlState.Normal)
    }
}
